function [ PDS ] = signal2pds( y )
%SIGNAL2PDS Summary of this function goes here
%   Detailed explanation goes here

[N M]= size(y);

NFFT= 2^nextpow2(N);
MFFT= 2^nextpow2(M);

if NFFT == 1
    PDS = fft(y,MFFT)/M;
    PDS = fftshift(PDS);
    PDS= 2*abs(PDS);
    return;
end

if MFFT == 1
    PDS = fft(y,NFFT)/N;
    PDS = fftshift(PDS);
    PDS= 2*abs(PDS);
    return;
end

PDS = fft2(y,NFFT, MFFT)/(N*M);
PDS = fftshift(PDS);
PDS= 2*abs(PDS);
end

